package cn.swing.his.passport.pojo.domain;

import lombok.Data;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Collection;
import java.util.List;

@Data
public class DoctorDetails implements Serializable, UserDetails {
    private static final long serialVersionUID = 1L;

    private Integer id;
    private String name;
    private String password;
    private String gender;
    private String telephone;
    private String description;
    private LocalDateTime birthday;
    private String idCard;
    private String academicParticipation;
    private String idCardImage;
    private String avatar;
    private String address;
    private String professionalTitle;
    private Integer roomId;
    private String station;
    private String email;
    private Integer isEnable;
    private List<DoctorAutority> authorities;

    @Override
    public Collection<? extends GrantedAuthority> getAuthorities() {
        return authorities;
    }

    @Override
    public String getUsername() {
        return null;
    }

    @Override
    public boolean isAccountNonExpired() {
        return true;
    }

    @Override
    public boolean isAccountNonLocked() {
        return true;
    }

    @Override
    public boolean isCredentialsNonExpired() {
        return true;
    }

    @Override
    public boolean isEnabled() {
        return true;
    }
}
